ALTER PROCEDURE Customers_Get
	@CompanyName NVarChar(40) = NULL
AS
BEGIN
	SELECT @CompanyName = 
		CASE WHEN RTRIM(@CompanyName) IS NULL
			THEN '%'
			ELSE @CompanyName + '%'
		END

	SELECT * 
		FROM Customers
		WHERE CompanyName LIKE @CompanyName
		ORDER BY CompanyName;
END
GO

--EXEC Customers_Get 'X'